package cn.tedu.review;
/*本类用于面向对象的复习*/
public class ReviewOOP {
    public static void main(String[] args) {
        BMW b = new BMW();
        b.setColor("五彩斑斓的黑");
        System.out.println(b.getColor());
        b.start();
    }

}
/*面向对象：强调的是结果，凡是都需要对象*/
/*面向对象的三大特征：封装，继承，多态*/
class BMW{
    {
        System.out.println("我是构造代码块");
    }

    private String color;
    private double price;

    public BMW() {
        this.color = color;
        this.price = price;
    }
    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void start(){
        System.out.println("车车启动了");
        stop();
    }
    private void stop(){
        System.out.println("车车停了");
    }
}
